import 'normalize.css/normalize.css'
import './assets/main.less'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { registerStore } from '@/store'
import setupDefaultSetting from '@/utils/setupDefaultSetting'

import App from './App.vue'
import router from './router'
import '@/assets/iconfont/iconfont'
import '@/assets/iconfont/iconfont2'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import directives from '@/utils/directive'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

import '@/utils/global'

const app = createApp(App)
for (const key in directives) {
  if (Object.prototype.hasOwnProperty.call(directives, key)) {
    app.directive(key, directives[key])
  }
}
app.use(Antd)
app.use(pinia)
registerStore()
app.use(router)
// app.use(ProLayout)
// app.use(PageContainer)
app.mount('#app')

setupDefaultSetting()

window.env = import.meta.env.MODE
